/**
 *
 */
package com.uaroadshow.webpay.entity;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("PayStatus")
public enum PayStatus {

    WAITING("等待支付"),

    PAID("已支付"),
    
    PARTIAL_PAID("部分支付");

    private String description;
    
    /**
     * @param description
     */
    PayStatus(String description) {
        this.description = description;
    }

    /**
     *
     * @param ordinal
     * @return
     */
    public static PayStatus ordinalOf(int ordinal) {
        for(PayStatus status : PayStatus.values()) {
            if(status.getOrdinal() == ordinal) {
                return status;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isWaiting() {
        return this.ordinal() == 0;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }

    /**
     *
     * @return
     */
    public String getName() {
        return this.name();
    }

    /**
     *
     * @return
     */
    public int getOrdinal() {
        return this.ordinal();
    }

}
